package com.yanqu.road.server.cmd.activity.douluodalu;


import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.pb.activity.douluodalu.DouLuoDaLuProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.douluodalu.CrossDouLuoDaLuMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_DOU_LUO_DA_LU_TEAM_LIST, desc = "队伍列表")
public class CrossDouLuoDaLuGetTeamListCmd extends CrossUnionCommand {

    long playerId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        playerId = packet.getPlayerId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        DouLuoDaLuProto.DouLuoDaLuGetTeamListCrossReqMsg reqMsg = DouLuoDaLuProto.DouLuoDaLuGetTeamListCrossReqMsg.parseFrom(packet.getBytes());

        int activityId = reqMsg.getActivityId();
        int type = reqMsg.getType();
        int page = reqMsg.getPage();

        MessageHelper.sendPacket(serverId, playerId, YanQuMessageUtils.buildMessage(Protocol.U_DOU_LUO_DA_LU_TEAM_LIST,
                CrossDouLuoDaLuMgr.getTeamListPageBuilder(activityId, page, type, playerId, serverId)));

    }

    @Override
    public void sendData() {

    }
}
